const getters = {
    userInfo: state => {
      if (state.user.userInfo && state.user.userInfo !== '') {
        return JSON.parse(state.user.userInfo)
      } else {
        return {}
      }
    },
    token: state => state.user.token,
    hasLoadAuthRouter: state => state.user.hasLoadAuthRouter,
    isLogin: state => {
      if (state.user.token && state.user.token !== '' && state.user.nickname !== '') {
        return true
      } else {
        return false
      }
    },
    roles: state => state.user.roles,
    auth_list: state => state.user.auth_list,
    addRouters: state => state.user.addRouters
  }
  export default getters